/**
 * 
 */
package org.cuatrovientos.hellokitti;

import java.util.Vector;

/**
 * Represents a basket full or not of food
 * @author carlos_ruiz
 *
 */
public class Basket {
	
	private Vector<Food> foods;
	
	/**
	 * 
	 */
	public Basket() {
		foods = new Vector<Food>();
	}
	
	/**
	 * insert a new food into the basket
	 * @param food
	 * @return 
	 */
	public void insertFood (Food food) {
		foods.add(food);
	}
	
	/**
	 * gives total weight of content
	 * @return
	 */
	public float totalWeight() {
		float total = 0;
		
		for (int i = 0; i < foods.size(); i++) {
			total = total + foods.get(i).getWeight();
		}
		
		return total;
	}
	
	/**
	 * return a String whit food data
	 * @return food data
	 */
	public String toString(){
		String result = "";
		// for each
		for (Food food : foods) {
			result = result + food.toString() + "\n";
		}
		
		return result;
	}
}







